package com.lzl.educms.controller;


import com.lzl.common_utils.R;
import com.lzl.educms.entity.CrmBanner;
import com.lzl.educms.service.CrmBannerService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前台banner管理接口
 * </p>
 *
 * @author testjava
 * @since 2022-04-05
 */
@RestController
@RequestMapping("/educms/bannerFront")
//@CrossOrigin
public class CrmFrontController {

    @Autowired
    private CrmBannerService crmBannerService;

    @ApiOperation(value = "获取首页banner")
    @GetMapping("getAllBanner")
    public R index() {
        //这里写service方法---因为这个前台业务需要redis
        List<CrmBanner> list = crmBannerService.selectAllBanner();
        return R.ok().data("bannerList", list);
    }

}

